<!doctype html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <title>Data Bunker Login</title>
    <script src="site.js"></script>
    <link rel="stylesheet" href="css/bootstrap.min.css">
    <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.6.3/css/all.css"
        integrity="sha384-UHRtZLI+pbxtHCWp1t77Bi1L4ZtiqrqD80Kn4Z8NTSRyMA2Fd33n5dQ8lWUE00s/" crossorigin="anonymous">
    <link rel="stylesheet" href="style.css">
    <script src="js/jquery.min.js"></script>
    <script src="js/bootstrap.bundle.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.15.10/highlight.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.15.10/languages/json.min.js"></script>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.15.10/styles/a11y-dark.min.css">
<script>
conf = loadUIConfiguration();
if (conf["custom_css_link"]) {
  document.write("<link rel='stylesheet' type='text/css' href='" + conf["custom_css_link"] +"' />");
}
</script>
</head>

<body>
    <div class="container col-md-6 pY-100">
		<script>
		conf = loadUIConfiguration();
		if (conf["LogoLink"]) {
		  document.write("<center><div class='col-6'><img class='logo img-responsive' src='"+conf["LogoLink"]+"'></div></center>" );
		}
		</script>
        <div class="row">
            <div class="bigblock">
                <h4>Record display</h4>
                <p id="msg">text</p>
                <pre id="data"></pre>
            </div>
        </div>
		<script>displayFooterLinks();</script>
    </div>
    <script>
        var record = window.localStorage.getItem('record');
        var ttype = window.localStorage.getItem('type');
        $('#msg').val("Display: " + ttype + " " + record);
        $.get("/v1/get/" + record, function (data) {
            if (data.status == "ok") {
                $('#msg').text("Data fetched.");
                var d = JSON.stringify(data.data, null, 4);
                $('#data').append('<code class="json">' + d + '</code>');
                document.querySelectorAll('pre code').forEach((block) => {
                    hljs.highlightBlock(block);
                });
            } else {
                alert("error");
            }
        }, "json");
    </script>
</body>
